<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib uri="/WEB-INF/page-base.tld" prefix="p"%>
<%String path=request.getContextPath(); %>
<script>
function user_adduserok(){
	var nodes=$("#userdeptshowtree").dynatree("getTree").getSelectedNodes();
    var nodestr="";
	for(i=0;i<nodes.length;i++){
		if(nodestr!="")
			nodestr+=","+nodes[i].data.key;
		else
			nodestr+=nodes[i].data.key;
	}
	$getByName('selectDepts',$w.currWinForm()).val(nodestr);
	
	$w.doWinForm(function(re){
		if(re.state=='addok')$w.closeCurrWin('ok');
	});
}
</script>
	<div class="easyui-panel" data-options="doSize:false,layoutH:37,border:false" >
	<form method="post"  action="/platform/user/UserManagePage.page">
		<p:hidden bind="bean.userid"/>
	    <p:hidden bind="actions"/>
	    <p:hidden bind="selectDepts"/>
	    <p:hidden bind="deptId"/>
		<div class="ui-formContent" style="margin-left:6px">
		
			<p style="width:250px;float:left">
				<label style="width:80px">登录账号：</label>
				<p:text bind="bean.loginname" style="width:136px" styleClass="easyui-validatebox" dataOptions="required:true"/>
			</p>
			<p style="width:240px;float:left">
				<label style="width:80px">登录密码：</label>
				<p:text bind="bean.userpwd" type="password" style="width:136px" styleClass="easyui-validatebox" dataOptions="required:true"/>
			</p>
			
			<div style="width:100%">
			<p style="width:250px;float:left">
				<label style="width:80px">用户姓名：</label>
				<p:text bind="bean.username" style="width:136px" styleClass="easyui-validatebox" dataOptions="required:true"/>
			</p>
			<p style="width:240px;float:left">
				<label style="width:80px;text-align:right">性&nbsp;&nbsp;&nbsp;&nbsp;别：</label>
				<p:equal bind="bean.sex" value="1">
		    	<label><input type="radio" name="bean.sex" value="0">男&nbsp;&nbsp;</label>
		    	<label><input type="radio" name="bean.sex" value="1" checked="checked">女</label>
		    	</p:equal>
		    	<p:notEqual bind="bean.sex" value="1">
		    	<label><input type="radio" name="bean.sex" value="0" checked="checked">男&nbsp;&nbsp;</label>
		    	<label><input type="radio" name="bean.sex" value="1">女</label>
		    	</p:notEqual>
			</p>
			</div>
			<div style="width:100%;float:left">
			<p style="width:250px;float:left">
				<label style="width:80px;text-align:right">办公电话：</label>
				<p:text bind="bean.phone" style="width:136px" styleClass="phone"/>
			</p>
			<p style="width:250px;float:left">
				<label style="width:80px;text-align:right">手&nbsp;&nbsp;&nbsp;&nbsp;机：</label>
				<p:text bind="bean.mobile" style="width:136px" styleClass="phone"/>
			</p>
			</div>
			<div style="width:100%">
			<p style="width:250px;float:left">
				<label style="width:80px;text-align:right">Email：</label>
				<p:text bind="bean.email" style="width:136px" styleClass="email"/>
			</p>
			<p style="width:250px;float:left">
				<label style="width:80px;text-align:right">Q Q：</label>
				<p:text bind="bean.qq" style="width:136px" styleClass="email"/>
			</p>
			</div>
			<div style="width:100%;clear:both">
				<label style="width:80px">通讯地址：</label>
				<p:text bind="bean.address" style="width:380px"/>
			</div>
			<div style="width:100%;clear:both;font-size:0px;height:5px"></div>
		 	<div title="部 门" class="easyui-panel" style="width:550px;">
				<div id="userdeptshowtree" style="width:100%;height:150px;overflow:auto"></div>
			</div>
		</div>
	</form>
</div>
<div class="ui-buttonBar">
	<a href="#" class="easyui-linkbutton" iconCls="icon_save" onclick="user_adduserok()">保 存</a>
	<a href="#" class="easyui-linkbutton" iconCls="icon_cancel" onclick="$w.closeCurrWin()">取 消</a>
</div>
<script>
   	$("#userdeptshowtree").dynatree({
		rootVisible: false,
		checkbox: true,
		selectMode: 1,
		initAjax: { 
               url: ctx+"/platform/dept/DeptTreeJson.json?nodeId=1&lazy=false&selectDept=true&userId="+$("input[name='bean.userid']",$w.currWinForm()).val()+"&deptId="+$("input[name='deptId']",$w.currWinForm()).val()
		}
	});
  	</script>